/*-
 * Copyright (c) 2006, 2007 FTS Team
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 4. Neither the name of the FTS Team nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *      Pair.hpp
 *
 * $FTS$
 */
#ifndef _PAIR_HPP__
#define _PAIR_HPP__ 1

/**
  @file Pair.hpp
  @brief Generic pair of values
*/

namespace FTSS // FullTextSearchSystem
{

/**
  @struct Pair Pair.hpp <Pair.hpp>
  @brief Pair
*/
template<typename TKey, typename TVal>struct Pair
{
	/** Key   */
	TKey     first;
	/** Value */
	TVal     second;

	/**
	  @brief Constructor
	  @param oKey - initial key
	  @param oVal - initial value
	*/
	inline Pair(const TKey & oKey = TKey(), const TVal & oVal = TVal()): first(oKey), second(oVal) { ;; }

	/**
	  @brief Copy Constructor
	  @param oPair - another pair
	*/
	inline Pair(const Pair<TKey, TVal> & oPair): first(oPair.first), second(oPair.second) { ;; }
};

} // namespace FTSS


	namespace MAIL
	{

	/**
	  @struct Pair Pair.hpp <Pair.hpp>
	  @brief A pair of key => value
	*/
	template <typename T, typename V>struct Pair
	{
		/* Key   */
		T      key;
		/* Value */
		V      value;

		/** Default Constructor */
		Pair(): key(), value() { ;; }

		/**
		  @brief Constructor
		  @param tKey   - key
		  @param tValue - value
		*/
		Pair(const T & tKey, const  V & tValue): key(tKey), value(tValue) { ;; }
/*	Pair(const T & tKey, const  V & tValue){
			key = tKey;
			value = tValue;
		}
*/

		inline Pair(const Pair<T, V> & oPair): key(oPair.key), value(oPair.value) { ;; }

		Pair & operator = (const Pair &a) { key = a.key; value = a.value; return *this;}
	};

} // namespace MAIL
#endif // _PAIR_HPP__
// End.
